package cn.cdeden.common.oss.annotation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

/**
 * @ProjectName : KnowCore01
 * @Package : cn.cdeden.resource.unified.annotation
 * @ClassName : StartWithA
 * @Author : Yu.
 * @Description : // TODO
 * @Date : 2024/12/4 15:50
 * @Version : 1.0
 */
@Documented
// 这个里面的StartWithAValidation.class就是我们第二步将要写的自定义校验器
@Constraint(
    validatedBy = SystemModuleValidation.class
)
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(SystemModule.List.class)
public @interface SystemModule {

    String message() default "系统没有该模块";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};


    @Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
    @Retention(RetentionPolicy.RUNTIME)
    @Documented
    public @interface List {
        SystemModule[] value();
    }
}
